package com.tiancai.pojo.po;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 
 * </p>
 *
 * @author tiancai
 * @since 2025-03-09
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Schema(name = "作品表")
public class Work implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 作品id
     */
    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "作品id")
    private Long id;

    /**
     * 作者id
     */
    @Schema(description = "作者id")
    private Long userId;
    /**
     * 原始用户Id
     */
    @Schema(description = "原始用户Id")
    private Long orginUserId;
    /**
     * 唯一标识
     */
    @Schema(description = "唯一标识")
    private String code;

    /**
     * 标题
     */
    @Schema(description = "标题")
    private String title;


    /**
     * 大小
     */
    @Schema(description = "大小")
    private String size;

    /**
     * 作品分类id
     */
    @Schema(description = "作品分类id")
    private Long categoryId;

    /**
     * 0-开放 1-可购买 2-可租赁 3-私有
     */
    @Schema(description = "0-开放 1-私有")
    private Integer status;

    /**
     * 收藏数
     */
    @Schema(description = "收藏数")
    private Long collectCount;

    /**
     * 浏览量
     */
    @Schema(description = "浏览量")
    private Long viewCount;

    /**
     * 描述
     */
    @Schema(description = "描述")
    private String description;
    /**
     * 创建时间
     */
    @Schema(description = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill= FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @Schema(description = "修改时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    /**
     * 图片信息
     */
    @Schema(description = "图片信息")
    private String img;
    /**
     * 源文件地址
     */
    @Schema(description = "源文件地址")
    private String sourceFile;

    /**
     * 价格 decimal(10,2)
     */
    @Schema(description = "价格 decimal(10,2)")
    private Double price;
    /**
     * 租赁价格
     */
    @Schema(description = "租赁价格")
    private Double rentPrice;
    /**
     * 货币类型
     */
    @Schema(description = "货币类型")
    private String currency;
    /**
     * 作品版权
     */
    @Schema(description = "作品版权")
    private Integer copyrightType;
}
